
d = data.tf;

%% Welke plot gaan we gebruiken
dabs = abs(d);
figure;
% Over freq..
daMean = mean(dabs,1);
daStd = std(dabs,1);
subplot(2,2,1);
plot(daStd(:), daMean(:), 'b.');
ylabel Mean
xlabel Std
legend Ruw
title 'Mean en Std over freq (Elk datapunt is een paar van Time, Trial)'
% Over tijd..
daMean = mean(dabs,2);
daStd = std(dabs,0,2);
subplot(2,2,3);
plot(daStd(:), daMean(:), 'b.');
ylabel Mean
xlabel Std
legend Ruw
title 'Mean en Std over tijd (Elk datapunt is een paar van Freq, Trial)'
subplot(2,2,4);
C =  repmat(data.freqs', [1,1,104]);
colormap hsv
colorbar
scatter(daStd(:), daMean(:), [], C(:), '.');
ylabel Mean
xlabel Std
% Over tijd..
daMean = mean(dabs,3);
daStd = std(dabs,0,3);
subplot(2,2,2);
plot(daStd(:), daMean(:), 'b.');
ylabel Mean
xlabel Std
legend Ruw
title 'Mean en Std over trials (Elk datapunt is een paar van Freq, Time)'

%% Nu ruw/log/means:
C =  repmat(data.freqs', [1,1,104]);
% Ruw
figure;
dabs = abs(d);
daMean = mean(dabs,2);
daStd = std(dabs,0,2);
% subplot(2,2,1);
colormap hsv
scatter(daStd(:), daMean(:), 0.5, C(:), '.');
colorbar
title 'DS T25 FHAmb Resp - Data'
ylabel Mean
xlabel Std
% Log
figure;
dabsl = log(dabs);
daMean = mean(dabsl,2);
daStd = std(dabsl,0,2);
% subplot(2,2,2);
colormap hsv
scatter(daStd(:), daMean(:), 0.5, C(:), '.');
colorbar
title 'DS T25 FHAmb Resp - Log(data)'
ylabel Mean
xlabel Std
% Mean
figure;
dabsm = dabs ./ repmat( mean(mean(dabs, 2),3), [1,1000,104]);
daMean = mean(dabsm,2);
daStd = std(dabsm,0,2);
% subplot(2,2,3);
colormap hsv
scatter(daStd(:), daMean(:), 0.5, C(:), '.');
colorbar
title 'DS T25 FHAmb Resp - Data/Mean_{over time & trials}'
ylabel Mean
xlabel Std


% dabs = log(abs(d));
% daMean = mean(dabs,2);
% daStd = std(dabs,0,2);
% figure; plot(daStd(:), daMean(:), 'r.');
% plot(daStd(:), daMean(:), 'r.');
% figure; plot(daStd(:), daMean(:), 'r.');
% ylabel Mean
% xlabel Std
% legend Log
% figure
% s1 = daStd(1:41,:,:);
% s2 = daStd(42:109,:,:);
% s3 = daStd(110:589,:,:);
% m1 = daMean(1:41,:,:);
% m2 = daMean(42:109,:,:);
% m3 = daMean(110:589,:,:);
% plot(s1(:), m1(:), 'r.');
% hold
% plot(s2(:), m2(:), 'b.');
% plot(s3(:), m3(:), 'g.');
% ylabel Mean
% xlabel Std
% legend Log
% legend ('<13Hz', '13-30Hz', '>30Hz')
% title 'Mean en Std over tijd (Elk datapunt is een paar van Freq, Trial)'
% dabs = log(abs(d));
% dabs = abs(d) ./ repmat( mean(abs(d), 2), [1,1000,1]);
% s1 = daStd(1:41,:,:);
% s2 = daStd(42:109,:,:);
% s3 = daStd(110:589,:,:);
% m1 = daMean(1:41,:,:);
% m2 = daMean(42:109,:,:);
% m3 = daMean(110:589,:,:);
% figure
% plot(s1(:), m1(:), 'r.');
% hold
% plot(s2(:), m2(:), 'b.');
% plot(s3(:), m3(:), 'g.');
% ylabel Mean
% xlabel Std
% legend ('<13Hz', '13-30Hz', '>30Hz')